<?php
namespace app\index\controller;
use think\Controller;
use think\Session;
use think\Db;
class Sessiond extends Controller
{
	
    //定义控制器初始化方法_initialize，在该控制器的方法调用之前首先执行。
    public function _initialize()
    {
        $request=  \think\Request::instance();//$request->controller()$request->module()."/".$request->action()
        
        $action= $request->controller();
		 $this->assign('action',$action); 
		  $this->assign('actionf',''); $this->assign('actionc',$request->action());  
		 
		 $userid=Session::get('userid');
		  $config= Db::name('config')->find();
		 $this->assign("config",$config);
		if(!$userid){
			
		header('Location: /index/index/login');die;
		}else{


		 $this->assign("userid",$userid);
		 
		 }
		 
		
    }


}
